<div class="breadcrumbwidget">
	<ul class="skins">
        <li><a href="default" class="skin-color default"></a></li>
        <li><a href="orange" class="skin-color orange"></a></li>
        <li>&nbsp;</li>
        <li class="fixed"><a href="" class="skin-layout fixed"></a></li>
        <li class="wide"><a href="" class="skin-layout wide"></a></li>
    </ul><!--skins-->
	<ul class="breadcrumb">
        <li><a href="<?php echo $baseurl?>">Trang chủ</a> <span class="divider">/</span></li>
        <li class="active">Quản lý chương trình</li>
    </ul>
</div><!--breadcrumbwidget-->
<div class="pagetitle">
	<h1>Thêm câu hỏi</h1> <span></span>
</div><!--pagetitle-->

<div class="maincontent">
<?php if(validation_errors()): ?>
    <div class="alert alert-error" style="margin: 10px 10px 10px 40px;">
      <button data-dismiss="alert" class="close" type="button">×</button>
      <?php echo validation_errors(); ?>
    </div>
<?php endif;?>
<?php if(!in_array($data, array(null, '', '0'))): ?>
    <div class="alert alert-error" style="margin: 10px 10px 10px 40px;">
      <button data-dismiss="alert" class="close" type="button">×</button>
      <?php if($data == 100): ?>
        <span>Thêm câu hỏi thất bại!</span>
      <?php endif;?>
    </div>
<?php endif;?>
	<div class="contentinner content-dashboard">
    
    <?php $attr = array('class' => 'stdform'); echo form_open('', $attr)?>
		
		
		<p>
			<label>Kiểm tra câu hỏi</label>
			<span class="formwrapper">
				<select data-placeholder="Viết câu hỏi vào đây..." style="width:350px" class="chzn-select" tabindex="2">
				  <option value="">Viết câu hỏi vào đây</option> 
				  <?php 
				  $list_question = json_decode($list_question);
				  foreach ( $list_question as $item ){ ?>
				  <option value="<?=$item?>"><?=$item?></option> 
				  <?php } ?>
				  
				</select>
			</span>
		</p>
		
        <p>
            <label>Chọn nhóm câu hỏi</label>
            <span class="field">
                <?php echo $fview->selectType($quest, $id = 0, 'cat_q');?>
            </span>
        </p>
        <p>
        	<label>Nội dung câu hỏi</label>
            <span class="field"><input type="text" name="question" class="input-xlarge check_content_question" placeholder="Nhập câu hỏi" value="<?php echo $this->input->post('question');?>"/></span>
        </p>
        <p>
        	<label>Phương án 1</label>
            <span class="field"><input type="text" name="choice-1" class="input-xlarge" placeholder="Nhập phương án 1" value="<?php echo $this->input->post('choice-1');?>"/></span>
        </p>
        <p>
        	<label>Phương án 2</label>
            <span class="field"><input type="text" name="choice-2" class="input-xlarge" placeholder="Nhập phương án 2" value="<?php echo $this->input->post('choice-2');?>"/></span>
        </p>
        <p>
        	<label>Phương án 3</label>
            <span class="field"><input type="text" name="choice-3" class="input-xlarge" placeholder="Nhập phương án 3" value="<?php echo $this->input->post('choice-3');?>"/></span>
        </p>
        <p>
        	<label>Phương án 4</label>
            <span class="field"><input type="text" name="choice-4" class="input-xlarge" placeholder="Nhập phương án 4" value="<?php echo $this->input->post('choice-4');?>"/></span>
        </p>
        <p>
        	<label>Đáp án</label>
            <span class="field"><input type="text" name="answer" class="input-xlarge" placeholder="Nhập đáp án" value="<?php echo $this->input->post('answer');?>"/></span>
        </p>
        <p>
            <label></label>
            <button class="btn btn-rounded" type="submit"> <i class="iconfa-ok"></i> &nbsp; Thêm</button>
        </p>
    </form>
    
    </div>
</div>

<script>
$( ".check_content_question" ).focusout(function() {
return false;
var question = $( ".check_content_question" ).val();
 $.ajax({
	type: "GET",
	url: '<?php echo $baseurl.'offline/check_content_question'?>',
	data:{ 
		question : question
	},
	success: function(data)
	{
		if(data==""){
			alert("");
		}else{
		alert(data);
		}
	}
}); // end ajax
})
</script>